#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QUrl>
#include <QDebug>
#include <QMessageBox>
#include <QFile>
#include <QTextStream>
#include <QStyledItemDelegate>
#include <QPainter>
#include <QListWidget>
#include <QDate>
#include <QTime>

namespace Ui {
    class MainWindow;
}

struct Link {
	QString desc;
    QString link;
    QString size;
    QDate date;
    QTime time;
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QList<Link> parseForLinks(QString);
    void addLinksToList(QList<Link>);
    QString lastLink;
    QListWidgetItem *lastItem;

public:
    void setAPIKey(QString);
    void setAPISecret(QString);
    QString getAPIKey();
    QString getAPISecret();

public slots:
    void downloadList();
    void downloadListFinished(QNetworkReply*);
    void downloadItem(QListWidgetItem*);
    void putDotIOResponded(QNetworkReply* reply);
};

#endif // MAINWINDOW_H
